package com.leeyu.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface OrderManageMapper {

    @Insert("insert into tb_order (id) values (#{id})")
    void save(String id);

    @Select("select order_state from tb_order where id = #{id} for update")
    int getOrderStateByIdForUpdate(String id);

    @Update("update tb_order set order_state = #{state} where id = #{orderId}")
    void updateOrderStateById(String orderId, int state);
}
